import { defineConfig } from 'wxt';
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

// See https://wxt.dev/api/config.html
export default defineConfig({
  extensionApi: 'chrome',
  modules: ['@wxt-dev/module-vue'],
  vite: ()=>{
    return {
      plugins: [
        // 自动导入 Element Plus 的 API，如 ElMessage 等
        AutoImport({
          resolvers: [ElementPlusResolver()],
        }),
        // 按需加载 Element Plus 组件
        Components({
          resolvers: [ElementPlusResolver()],
        }),
      ],
    }
  }
});
